home *** CD-ROM | disk | FTP | other *** search
-
- **************************************************
-
- // WINDOW.H (Listing 9)
- // Window class header -- Williams
- #ifndef _WINCLASSDEF
- #define _WINCLASSDEF
-
- #include <stddef.h>
- #include <conio.h>
- #include "region.h"
-
-
- // The basic window class
- extern class win : public region
- {
- protected:
-
- // Class variable holds top window
- static win *topwin;
- // Last window
- static win *lastwin;
-
- // Cursor location when window isn't on top
- int oldx;
- int oldy;
-
- // Default screen color
- unsigned int color;
-
- // Pointer to next window on stack
- win *next; // Pointer to next window
- win *prev; // Previous window
-
- // Margins support borders on the windows
- int margin;
-
- // Private method to register top window
- void settop(void);
-
- public:
- // Methods:
- // Constructor:
- win(int x0=1,int y0=1,int x1=80,int y1=25,
- unsigned int clr=7,int mar=0);
-
- // Destructor. This is virtual to support
- // boxwindows, etc.
- virtual ~win();
-
- // Force window to top of stack
- void maketop(void);
- // Set color
- void setcolor(int n)
- {
- color=n;
- }
- // Fetch top window
- static win *top_window(void)
- {
- return topwin;
- }
- };
-
- // Windows with borders
- extern class boxwin : public win
- {
- public:
- boxwin(int x0=2,int y0=2,int x1=79,int y1=24,
- unsigned int clr=7,int boxt=0);
- };
-
- // General purpose box drawing routine
- void draw_box(int type,int x0,int y0,int x1,int y1);
-
- #endif
-
-
-
-